package o;

import android.os.Handler;
import android.os.SystemClock;

public abstract class czc {
    private Handler ˊ = new Handler(this) {
        final /* synthetic */ czc ˎ;

        {
            this.ˎ = r1;
        }

        /* JADX WARNING: inconsistent code. */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public void handleMessage(android.os.Message r11) {
            /*
            r10 = this;
            r0 = 0;
            r4 = r10.ˎ;
            monitor-enter(r4);
            r2 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r2 = r2.ॱ;	 Catch:{ all -> 0x0025 }
            if (r2 == 0) goto L_0x000f;
        L_0x000d:
            monitor-exit(r4);	 Catch:{ all -> 0x0025 }
        L_0x000e:
            return;
        L_0x000f:
            r2 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r2 = r2.ˏ;	 Catch:{ all -> 0x0025 }
            r6 = android.os.SystemClock.elapsedRealtime();	 Catch:{ all -> 0x0025 }
            r2 = r2 - r6;
            r5 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1));
            if (r5 > 0) goto L_0x0028;
        L_0x001e:
            r0 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r0.ˏ();	 Catch:{ all -> 0x0025 }
        L_0x0023:
            monitor-exit(r4);	 Catch:{ all -> 0x0025 }
            goto L_0x000e;
        L_0x0025:
            r0 = move-exception;
            monitor-exit(r4);	 Catch:{ all -> 0x0025 }
            throw r0;
        L_0x0028:
            r6 = android.os.SystemClock.elapsedRealtime();	 Catch:{ all -> 0x0025 }
            r5 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r5.ˊ(r2);	 Catch:{ all -> 0x0025 }
            r8 = android.os.SystemClock.elapsedRealtime();	 Catch:{ all -> 0x0025 }
            r6 = r8 - r6;
            r5 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r8 = r5.ˋ;	 Catch:{ all -> 0x0025 }
            r5 = (r2 > r8 ? 1 : (r2 == r8 ? 0 : -1));
            if (r5 >= 0) goto L_0x004f;
        L_0x0041:
            r2 = r2 - r6;
            r5 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1));
            if (r5 >= 0) goto L_0x0062;
        L_0x0046:
            r2 = 1;
            r2 = r10.obtainMessage(r2);	 Catch:{ all -> 0x0025 }
            r10.sendMessageDelayed(r2, r0);	 Catch:{ all -> 0x0025 }
            goto L_0x0023;
        L_0x004f:
            r2 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r2 = r2.ˋ;	 Catch:{ all -> 0x0025 }
            r2 = r2 - r6;
        L_0x0056:
            r5 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1));
            if (r5 >= 0) goto L_0x0062;
        L_0x005a:
            r5 = r10.ˎ;	 Catch:{ all -> 0x0025 }
            r6 = r5.ˋ;	 Catch:{ all -> 0x0025 }
            r2 = r2 + r6;
            goto L_0x0056;
        L_0x0062:
            r0 = r2;
            goto L_0x0046;
            */
            throw new UnsupportedOperationException("Method not decompiled: o.czc.4.handleMessage(android.os.Message):void");
        }
    };
    private final long ˋ;
    private final long ˎ;
    private long ˏ;
    private boolean ॱ = false;

    public abstract void ˊ(long j);

    public abstract void ˏ();

    public czc(long j, long j2) {
        this.ˎ = j;
        this.ˋ = j2;
    }

    public final synchronized void ˎ() {
        this.ॱ = true;
        this.ˊ.removeMessages(1);
    }

    public final synchronized czc ॱ() {
        czc o_czc;
        this.ॱ = false;
        if (this.ˎ <= 0) {
            ˏ();
            o_czc = this;
        } else {
            this.ˏ = SystemClock.elapsedRealtime() + this.ˎ;
            this.ˊ.sendMessage(this.ˊ.obtainMessage(1));
            o_czc = this;
        }
        return o_czc;
    }
}
